# include<pthread.h>
# include "myls.h"


void main(int argc , char* argv[])
{

	char  *bufDir = (char *)malloc(MAX_FILE_LIST * sizeof(char));//缓冲区：存放当前目录

	if(argc == 1)
	{
	//获取当前路径
		if(getcwd(bufDir,256) == NULL)
		{
		perror("getcwd");
		return ;
		}
		create_myls_thread(bufDir,NULL);
	}else if(argc == 2)
	{
		create_myls_thread(argv[1], NULL);
	}else{
		perror("parameter");
		return ;
	}

	free(bufDir);
	bufDir=NULL;
	//pthread_exit(NULL);
    
}

